﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZHDJ.Core;
using ZHDJ.Data.DataCaching;
using ZHDJ.Data.Models.Common;
using ZHDJ.WebPage;

namespace ZHDJ.Web.Portal.Edu
{
    public partial class PartyEduHonourDetail : PortalPage
    {
        #region 页面属性
        public string ArticleID
        {
            get
            {
                return this.Request["id"];
            }
        }
        public string CategoryName
        {
            get; set;
        }
        public string Category
        {
            get; set;
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            var dt = PartyArticle.GetArticleSingle(ArticleID);
            foreach (DataRow dr in dt.Rows)
            {
                CategoryName = Convert.ToString(dr["CategoryName"]);
                Category = Convert.ToString(dr["Category"]);
                this.lblTitle.Text = Convert.ToString(dr["Title"]);
                this.lblTime.Text = Convert.ToDateTime(dr["CreateTime"]).ToString("yyyy-MM-dd HH:mm:ss");
                this.lbBranch.Text = "发布：" + SystemParameterCaching.Get(SystemParameterKey.WebArticleHostName);
                this.ltContent.Text = Convert.ToString(dr["Content"]);
                if (!string.IsNullOrEmpty(Convert.ToString(dr["ImageID"])))
                {
                    ImageAuto.ImgUrl = UpFileBusiness.GetFileUrl(Convert.ToString(dr["ImageID"]));
                }
                else
                {
                    ImageAuto.Visible = false;
                }
                break;
            }

        }
    }
}